package com.benz.user.controller;

import com.benz.user.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
@RequestMapping("/users")
public class UserController {
    @Autowired
    private OrderFeignClient orderFeignClient;
   /* @GetMapping()
    public Map<String,Object> getUserList(@RequestParam String searchVal,@RequestParam Integer page,@RequestParam Integer offset){
        Map<String,Object> map = new HashMap<>();
        map.put("searchVal",searchVal);
        map.put("page",page);
        map.put("offset",offset);
        map.put("offset1",offset);
        return map;
    }*/
 /*   @GetMapping("/{id}")
    public User getUser(@PathVariable Long id){
        User user = userService.getUserById(id);
        return user;
    }*/
   /* @PostMapping
    public User createUser(@RequestBody User user){
        return user;
    }*/
    /*@GetMapping("getOrderNo")
    public String getOrderNo(String userId){
        return userService.getOrderByNo(userId);
    }*/
       @GetMapping("/getOrderNo")
   public String getOrderByNo(@RequestParam String orderId) {
       return orderFeignClient.getOrderByNo(orderId);
   }
}